﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="maintenancePostsAdd.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.maintenancePostsAdd" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">

        .st
        {
            font-size: medium;
        }
        .style3
        {
            font-size: x-large;
            text-decoration: underline;
            color: #3399FF;
        }
        .style4
        {
            font-size: x-large;
        }
        .style5
        {
            color: #3366FF;
        }
        .style6
        {
            font-style: normal;
        }
        .style7
        {
            font-size: small;
        }
        .maintenancePostsAddListView
        {
            height: 851px;
        }
        .maintenancePostObjectsAdd
        {
            height: 116px;
        }
        .maintenancePostsAddListViewObject
        {
            height: 52px;
        }
        .AverageLikesMaintenancePosts
        {
            width: 310px;
            height: 111px;
            text-align: center;
            font-size: large;
            font-weight: 700;
        }
        .style8
        {
            float: right;
            width: 310px;
            height: 111px;
            text-align: center;
            font-size: large;
        }
        .style9
        {
            text-decoration: underline;
        }
        .maintenancePostObjectsAddContentLabel
        {
            height: 81px;
            text-align: left;
        }
        .ratingTool
        {
            height: 101px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <strong><span class="style4">BMW - X6 </span></strong><span class="style3"><em>
        <strong>Maintenance</strong></em></span><strong><span class="style4"> Discussion Forum 
        Posts...</span></strong></p>
        <div class = "mainContent">
            <br />
       <div class = "discussionTitle">
       
        <span class="st">
    
    
    
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="MaintenanceDisID" 
            DataSourceID="SqlDataSource1" Width="869px" Font-Bold="True" 
            Font-Italic="True" Font-Size="Medium" ForeColor="#FF6600" Height="81px">
            <EditItemTemplate>

                MaintenanceDisID:
                <asp:Label ID="MaintenanceDisIDLabel1" runat="server" 
                    Text='<%# Eval("MaintenanceDisID") %>' />
                <br />

                Title:
                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                Title:
                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                <br />

                <span class="style5"><span class="style6">Title:</span> </span>
                <asp:Label ID="TitleLabel" runat="server" CssClass="style5" 
                    Text='<%# Bind("Title") %>' />
                <br />

            </ItemTemplate>
        </asp:FormView>
            <br />
        </span>
       
        <span class="style7">
    
    
    
            <div class = "ratingTool">
        </span>
       
                <strong>
       
        <span class="style7">
    
    
    
                <em>To rate this discussion, simply choose the scale from 1 - 5 by 
                clicking on the BMW logo below and then click on rate.</em></span><span class="st"><span 
                    class="style7">
        </span>
       
        </span>
       
                </strong>
       
        <span class="st">
    
    
    
                &nbsp;<asp:Rating ID="Rating1" runat="server" EmptyStarCssClass="empty" 
            FilledStarCssClass="bmwDone" StarCssClass="bmw" WaitingStarCssClass="empty">
                </asp:Rating>
                <br />
                <br />
            <asp:Button ID="btnRate" runat="server" BackColor="#6699FF" Height="34px" 
            Text="Rate" Width="133px" />
                            &nbsp;<br />

                
            
            </div>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                
               SelectCommand="SELECT MaintenanceDisID, Title FROM Maintenance_Discussion WHERE (MaintenanceDisID = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="MaintenanceDisID" QueryStringField="id" 
                        Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
        </span>
       
       </div>
        <div class = "style7">
        
    
        Below are the posts replied to the discussion title shown above. To add a post 
        to this discussion, simply enter your message into the textbox below and click on 
        post.
    
    
            <br />
    
    
        </div>

        <div class = "maintenancePostObjectsAdd">
        <div class = "style8">
        
            <span class="style9"><strong>Average Rating</strong></span><br />
        <div class = "maintenancePostObjectsAddContentLabel">
        
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="lblAverageRatings" runat="server" Text="Label" Font-Size="Medium" 
                    BorderStyle="Inset" Width="57px"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Image ID="imgSmileyFace" runat="server" 
                ImageUrl="~/Pictures/smileyface.jpg" />
            <asp:Image ID="imgAngryFace" runat="server" Height="61px" 
                ImageUrl="~/Pictures/angryface.jpg" Width="61px" />
        
        </div> 
        </div>
        <span class="st">
            
                <asp:TextBox ID="txtmaintenancepost" runat="server" BorderStyle="Solid" 
                    Height="94px" TextMode="MultiLine" Width="434px" 
            BorderColor="Silver"></asp:TextBox>
&nbsp; <asp:Button ID="btnmaintenancepost" runat="server" Height="31px" Text="Post" 
                    Width="121px" BackColor="#99CCFF" />
            
            <br />
            
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtmaintenancepost" 
                    ErrorMessage="Please enter a post in the textbox provided and click on post." 
                    Font-Bold="True" Font-Italic="True" ForeColor="Red"></asp:RequiredFieldValidator>
        
        </span>
    <br />
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>
                
        <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource2">
                    <AlternatingItemTemplate>
                        
                        
                        <strong>Post Message Replied:</strong>
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        <strong>Date Posted:</strong>
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        <strong>Time Posted:</strong>
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        <strong>Posted by:</strong>
                         <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        
                        <br /></span>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        PostID:
                        <asp:Label ID="PostIDLabel1" runat="server" Text='<%# Eval("PostID") %>' />
                        <br />
                        PostBody:
                        <asp:TextBox ID="PostBodyTextBox" runat="server" 
                            Text='<%# Bind("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:TextBox ID="DatePostedTextBox" runat="server" 
                            Text='<%# Bind("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:TextBox ID="TimePostedTextBox" runat="server" 
                            Text='<%# Bind("TimePosted") %>' />
                        <br />
                        UserName:
                         <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        MaintenanceDisIDFK:
                        <asp:TextBox ID="MaintenanceDisIDFKTextBox" runat="server" 
                            Text='<%# Bind("MaintenanceDisIDFK") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br /><br /></span>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <span>No data was returned.</span>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <span style="">PostBody:
                        <asp:TextBox ID="PostBodyTextBox" runat="server" 
                            Text='<%# Bind("PostBody") %>' />
                        <br />DatePosted:
                        <asp:TextBox ID="DatePostedTextBox" runat="server" 
                            Text='<%# Bind("DatePosted") %>' />
                        <br />TimePosted:
                        <asp:TextBox ID="TimePostedTextBox" runat="server" 
                            Text='<%# Bind("TimePosted") %>' />
                        <br />UserName:
                         <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />MaintenanceDisIDFK:
                        <asp:TextBox ID="MaintenanceDisIDFKTextBox" runat="server" 
                            Text='<%# Bind("MaintenanceDisIDFK") %>' />
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                        <br /><br /></span>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        
                        
                        <strong>Post Message Replied:</strong>
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        <strong>Date Posted:</strong>
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        <strong>Time Posted:</strong>
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        <strong>Posted by:</strong>
                         <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        
<br /></span>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div ID="itemPlaceholderContainer" runat="server" 
                            style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                            <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <span style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">
                        PostID:
                        <asp:Label ID="PostIDLabel" runat="server" Text='<%# Eval("PostID") %>' />
                        <br />
                        PostBody:
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        UserName:
                         <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                        <br />
                        MaintenanceDisIDFK:
                        <asp:Label ID="MaintenanceDisIDFKLabel" runat="server" 
                            Text='<%# Eval("MaintenanceDisIDFK") %>' />
                        <br />
<br /></span>
                    </SelectedItemTemplate>
                </asp:ListView>
    
        </div>

        <div class = "maintenancePostsAddListView">
        <div class = "maintenancePostsAddListViewObject">
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                    
                    SelectCommand="SELECT Maintenance_Posts.PostID, Maintenance_Posts.PostBody, Maintenance_Posts.DatePosted, Maintenance_Posts.TimePosted, aspnet_Users.UserName, Maintenance_Posts.MaintenanceDisIDFK FROM (aspnet_Users INNER JOIN Maintenance_Posts ON aspnet_Users.UserId = Maintenance_Posts.UserIDFK) WHERE (Maintenance_Posts.MaintenanceDisIDFK = ?) ORDER BY Maintenance_Posts.PostID DESC">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="?" QueryStringField="id" />
                    </SelectParameters>
                </asp:SqlDataSource>
        </div>
        </div>
        </div>
</asp:Content>
